package com.jye.cloud.user.mapper;

import com.jye.cloud.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserMapper {


    User findUserById(@Param("id")int id);

    //增加用户
    void addUser(@Param("user") User user);

    //查找所有User
    List<User> findAllUser();

    String findUserNameById(@Param("id")int id);


    void updateUser(@Param("user")User user);

    List<Date> findUserLoginHistoryById(@Param("id")int id);

    User login(@Param("username")String username, @Param("password")String password);

    void updateLoginRecord(@Param("id") Integer id, @Param("lastLoginTime") Date lastLoginTime);

    int isExitUsername(@Param("username")String username);
}
